﻿@model TidyBlog.MVC.WWW.Models.ArticleIndex

@{
	Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="main">
	<div class="inner">
@if (Model.ArticleData != null && Model.ArticleData.PageCount > 0)
{
	foreach (var article in Model.ArticleData.Data)
	{
		var routeValues = new { id = article.ArticleId };
		var postTime = article.PostTime.AddHours(ViewBag.Setup.TimeZone);
		<article class="article">
			<header>
				<time datetime="@postTime.ToString("yyyy-MM-ddThh:mm:sszzz")" class="article-postdate"><span class="day">@postTime.Day</span>@postTime.ToString("MMM", TidyBlog.BLL.ArticleBLL.DateCulture).ToUpper()</time>
				<h2 class="article-title"><a href="@Url.Action("Detail", routeValues)">@article.Title</a></h2>
				<ul class="clearfix">
					<li>分类：<a href="@Url.Action("Index", new { id = article.CategoryId })">@article.CategoryName</a></li>
					<li>浏览次数：<a href="@Url.Action("Detail", routeValues)">@article.ViewCount</a></li>
					<li>评论次数：<a href="@Url.Action("Detail", routeValues)#comment-list">@article.CommentCount</a></li>
				</ul>
			</header>
			<div class="article-content">@Html.Raw(article.Summary)</div>
			<footer>
				<ul class="clearfix">
					<li class="article-posttime"><address>@article.AuthorName</address> 发表于
					<time datetime="@postTime.ToString("yyyy-MM-ddThh:mm:sszzz")">@postTime.ToString("yyyy-M-d H:mm")</time></li>
					<li class="article-entry"><a href="@Url.Action("Detail", routeValues)">阅读全文 &raquo;</a></li>
				</ul>
			</footer>
		</article>
	}
		{ Html.RenderPartial("_Paginator", Model.ArticlePaginator); }
}
	</div>
</div>

<aside class="sidebar">
@{
	Html.RenderPartial("Sidebar_ArticleList", Model.RecommendArticles);
	Html.RenderPartial("Sidebar_ArticleRank", Model.ArticleViewRank);
	Html.RenderPartial("Sidebar_SinaWeibo");
	Html.RenderPartial("Sidebar_Others");
	Html.RenderPartial("Sidebar_Links");
}
</aside>

@section Script {
<script>require('/page/article/index/1.x/');</script>
}